package top.dprkshow.springboothelloworld.utils;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class UUIDUtil {

    public UUIDUtil() {
    }

    public static String getUUID() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmssSSS");
        StringBuilder id = new StringBuilder(sdf.format(new Date()));
        DecimalFormat df = new DecimalFormat("000000000");
        String random = df.format(new Random().nextInt(999999999));
        id.append(random);
        return String.valueOf(id);
    }

    public static void main(String[] arg) {
        System.out.println(getUUID());
    }

}